<?php

//namespace controllers\admin;

class AdminAddressController extends BaseController {
	
	/**
	 * The layout that should be used for responses.
	 */
	protected $layout = 'layouts.admin';
	/**
	 * 
	 */
	public function showProvinces(){
		//$page = Input::get('page',1);
		//paginate会自动处理分页数字
		$provinces = Province::all();
		// 		$products = Products::withTrashed()->orderBy('id','desc')->forPage(50,2)->get();
		$content = View::make('admin.address.provinces');
		$this->layout->content = $content;
		$content->with("provinces",$provinces);
	}
	
	/**
	 *
	 */
	public function showCitys($id){
		//$page = Input::get('page',1);
		//paginate会自动处理分页数字
		$province = Province::with("citys")->find($id);
		// 		$products = Products::withTrashed()->orderBy('id','desc')->forPage(50,2)->get();
		$content = View::make('admin.address.citys');
		$this->layout->content = $content;
		$content->with("province",$province);
	}
	
	/**
	 *
	 */
	public function showDistricts($id){
		//$page = Input::get('page',1);
		//paginate会自动处理分页数字
		$city = City::with("province","districts")->find($id);
		// 		$products = Products::withTrashed()->orderBy('id','desc')->forPage(50,2)->get();
		$content = View::make('admin.address.districts');
		$this->layout->content = $content;
		$content->with("city",$city);
	}
}

?>